//
//  HDNavigationController.m
//  AccountEasy
//
//  Created by mac on 2020/7/22.
//  Copyright © 2020 AccountEasy. All rights reserved.
//

#import "HDNavigationController.h"

@interface HDNavigationController ()<UIGestureRecognizerDelegate>

@end

@implementation HDNavigationController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //系统侧滑功能开启
    self.interactivePopGestureRecognizer.delegate = self;
}

//侧滑实现
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    if (self.viewControllers.count == 1)
    {
        return NO;
    }
    else
    {
        NSString *path = [[NSBundle mainBundle] pathForResource:@"UnGuesBackList.plist" ofType:nil];
        NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:path];
        NSArray *classArr = [NSArray arrayWithArray:dic[@"ClassName"]];
        
        NSString *classStr = NSStringFromClass([self.topViewController class]);
        if ([classArr containsObject:classStr])
        {
            return NO;
        }
        else
        {
            return YES;
        }
    }
}

@end
